package com.fbs.api;

import com.fbs.framework.common.IdParam;
import com.fbs.framework.common.ResponseData;
import com.fbs.framework.exception.ParamException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/*
创建者:虾米糖
*/
@RestController
@Slf4j
public class DameController {

    @PostMapping("/test")
    @ResponseBody
    public ResponseData test(){
        log.info("111");
        return new ResponseData() ;
    }

    @PostMapping("/info")
    public ResponseData info(@RequestBody IdParam param){
        if (param.getId()==null || param.getId()!=1){
         throw new ParamException("id is null");
        }
        return new ResponseData() ;
    }
}
